package com.wh.consumer8282.api;

import com.wh.consumer8282.bean.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Auther: HuiEr
 * @Date: 2020/3/25 8:38
 * @Description
 */
@Component
public class FeignFallbackFactory implements FallbackFactory<ProducerFeign> {
    @Override
    public ProducerFeign create(Throwable throwable) {
        return new ProducerFeign() {
            @Override
            public List<User> user_list() {
                ArrayList<User> list = new ArrayList<>();
                list.add(new User());
                return list;
            }
        };
    }
}
